<!DOCTYPE html>
<html>
<head>
<jsp:include page="../include/meta.jsp" />
<title><c:choose><c:when test="${selectedType==null}">最新资讯</c:when><c:otherwise>${selectedType.name}</c:otherwise></c:choose> - <smt:dict code="company.name" /></title>
<style>
.aside-container li a.cur, .aside-container li a:hover {
    background: #999;
    color: #fff;
}
body {
    overflow: auto !important;
    font-family: "Microsoft YaHei" ! important;
}

.container {margin: 0 auto;}

.aside-container li a {
    height: 30px;
    line-height: 30px;
    display: block;
    border-radius: 10px/10px;    
}

article {  
	padding: 0 !important; 
}
</style>
<script src="resources/js/jquery-1.9.1.js"></script>
</head> 
<body class="open">
<jsp:include page="../include/navbar.jsp"/>
<div id="banner-re" class="hidden-md-down" style="text-align: center;">
    <img src="upload/images/desktop/subbanner1.jpg" class="img-fluid">
</div>
<div class="container">
	<div class="row">
	<div class="col-3" style="min-height: 600px; background: #fff;">
		<div style="background: #fff; color: #666; padding: 20px 10px;">
		<h1><a href="index.html"><img alt="logo图片" src="upload/images/logo.png" width="100%" /></a></h1><br>
		<div class="qrcode aside-container"><img src="upload/images/qrcode.jpg" /><p>扫一扫微信二维码<i></i></p>
		</div>
		<nav class="aside-container">
		<ul>
			<li><a href="index.html">网站首页</a></li>
			<li><a class="cur" href="#">财富热点</a></li>
		</ul>
		</nav>
		<!--footer>
		<br />
		<smt:dict code="site.copyright" />
		</footer-->
		</div>
	</div>
	<div class="col-9">
		<div class="inner-wrap">
			<div class="news-cate"> 
				<c:forEach var="type" items="${infoTypes}">
					<c:if test="${!type.code.startsWith('spec')}">
		        	<a class="<c:if test="${cond.typeId eq type.id}">cur</c:if>" href="info/list?typeId=${type.id}" 
		        		style="height: 40px; line-height: 40px;">${type.name}</a>
		        	</c:if>
		        </c:forEach>
			</div>
			<br />
			<ul class="news-list clearfix">
				<c:forEach var="info" items="${page.content}">
				<li class="clearfix">
					<div class="news-img">
						<a title="${info.title}" href="info/${info.id}.html" class="img">
							<img src="${info.image}" alt="${info.title }" />
						</a>
						<div class="bl"></div>
					</div> 
					<h2><a href="info/${info.id}.html">${info.title}</a></h2>
					<p class="info" style="white-space:nowrap;">时间：<fmt:formatDate value="${info.timeCreated}" pattern="yyyy-MM-dd"/><u>•</u> 点击：${info.viewCount} 次</p>
					<p class="desc">${info.abstraction}</p>
					<a href="info/${info.id}.html" class="more">查看详情>></a>
					<p class="date"><fmt:formatDate value="${info.timeCreated}" pattern="dd"/><span><fmt:formatDate value="${info.timeCreated}" pattern="MM"/></span></p>				
				</li>
				</c:forEach>
			</ul>
	
			<div class="pages" page="${page.pageNumber}" totalPages="${page.totalPages}">&nbsp;&nbsp;
				<a class="first" isFirst="${page.first}" href="javascript:;" title="第一页">&lt;&lt;</a>
				<a class="prev" href="javascript:;" title="上一页">&lt;</a>
				<c:forEach varStatus="status" begin="${page.beginPage}" end="${page.endPage}" step="1">
				<a href="javascript:;" page="${status.current}" class="num">${status.current}</a>
				</c:forEach>
				<a class="next" href="javascript:;" title="下一页">&gt;</a>
				<a class="last" href="javascript:;" title="最后一页">&gt;&gt;</a>
			</div>
		</div>
	</div>
	</div>
</div>

<script>
$(".sub-nav .switch").click(function(){ 
	if($('body').hasClass('open')){
		$(this).attr('data-icon',9);		
		$('body').removeClass('open').addClass('close');
	}else{
		$(this).attr('data-icon',8);
		$('body').removeClass('close').addClass('open');
	}
	
});
$(".btns .up").click(function(){ 
	$("html,body").animate({scrollTop:0},600);
});
$(".news-cate-dropdown button").click(function(){
	var box=$(".news-cate-dropdown");
	if(box.hasClass("active")){
		box.removeClass("active");
	}else{
		box.addClass('active');
	}
})

function initSimplePagination(selector, url){
	var pageNumber = parseInt($(selector).attr('page'));
	var totalPages = parseInt($(selector).attr('totalPages'));
	var prevPageNumber;
	var nextPageNumber;
	if (pageNumber>2){
		prevPageNumber = pageNumber - 1;
	} else{
		prevPageNumber = 1;
	}
	if (pageNumber<totalPages){
		nextPageNumber = pageNumber + 1;
	} else{
		nextPageNumber = totalPages;
	}
	
	$(selector +' a[page=' + pageNumber + ']').addClass('active');
	
	if(url.indexOf('?')==-1){
		url = url + '?';
	}
	else{
		url = url + '&';
	}
	$(selector + ' .first').click(function(){
		toLocation(url + "pageNumber=1");
	});
	$(selector + ' .prev').click(function(){
		toLocation(url + "pageNumber=" + prevPageNumber);
	});
	$(selector + ' .next').click(function(){
		toLocation(url + "pageNumber=" + nextPageNumber);
	});
	$(selector + ' .last').click(function(){
		toLocation(url + "pageNumber=" + totalPages);
	});

	$(selector +' a[page]').click(function(){
		var pageNumber = $(this).attr('page');
		toLocation(url + "pageNumber=" + pageNumber);
	});
}

function toLocation(location) {
	var base = $('base').attr('href');
	document.location.href = (base + location);
};

var url = 'info/list?a=a<c:if test="${cond.typeId ne null}">&typeId=${cond.typeId}</c:if>';
initSimplePagination('.pages', url);

var menuChain = [
<c:forEach var="theMenu" items="${menuChain}">
'${theMenu.id}',
</c:forEach>
'',
'6990652745667375136'
];

$('#menu > li > a').each(function(){
	if($(this).attr('menuId')== menuChain[1]) {
		$(this).parent().addClass('active');
	}
});
</script>
</body>
</html>